/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.util.UUID;

/**
 *
 * @author Thinh
 */
public class Utils {

    /**
     * Returns the sql.Date for the given util.Date
     *
     * @param oDate util.Date object
     * @return sql.Date
     */
    public static java.sql.Date convertToSqlDate(java.util.Date oDate) {
        return (new java.sql.Date(oDate.getTime()));
    }

    /**
     * Returns the util.Date for the given sql.Date
     *
     * @param sqlDate sql.Date object
     * @return util.Date
     */
    public static java.util.Date convertToDate(java.sql.Date sqlDate) {
        return (new java.util.Date(sqlDate.getTime()));
    }

    /**
     * Generate unique ID for confirmation order.
     * @return unique confirmation string.
     */
    public static String generateUUID(){
        UUID uid = UUID.randomUUID();
        return String.valueOf(uid);
    }
    
}
